package cn.nawang.ebeim.api.service.impl;


import java.util.Date;
import java.util.List;
import java.util.UUID;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.nawang.ebeim.api.comm.PageList;
import cn.nawang.ebeim.api.comm.Pages;
import cn.nawang.ebeim.api.domain.UserBeHaviorsLog;
import cn.nawang.ebeim.api.repository.UserBehaviorsLogRepository;
import cn.nawang.ebeim.api.service.UserBehaviorsLogService;


@Service("userBehaviorsLogService")
public class UserBehaviorsLogServiceImpl implements UserBehaviorsLogService {
    private static final Logger LOG = LoggerFactory.getLogger(UserBehaviorsLogServiceImpl.class);

    @Autowired
    private UserBehaviorsLogRepository userBehaviorsLogRepository;


    @Override
    public void save(UserBeHaviorsLog userBeHaviorsLog) {
        userBeHaviorsLog.setId(UUID.randomUUID().toString());
        userBehaviorsLogRepository.save(userBeHaviorsLog);

    }
    
   

    @Override
    public void update(UserBeHaviorsLog userBeHaviorsLog) {

    }

    @Override
    public int deleteExpireBackupLog(Date updateTime) {
        return userBehaviorsLogRepository.deleteExpireBackupLog(updateTime);
    }

    @Override
    public PageList<UserBeHaviorsLog> findByPage(UserBeHaviorsLog userBeHaviorsLog, Pages page) {
        return userBehaviorsLogRepository.findByPage(userBeHaviorsLog,page);
    }

//    @Override
//    public List<UserBeHaviorsLog> findByBackupLog(UserBeHaviorsLog userBeHaviorsLog) {
//       return userBehaviorsLogRepository.findByBackupLog(userBeHaviorsLog);
//    }



    @Override
    public void bulkInsert(List<UserBeHaviorsLog> list) {
        userBehaviorsLogRepository.save(list);
    }


}
